package io;

import java.io.*;

public class BRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("./src/io/BRDemo.java");//字节流
        InputStreamReader isr = new InputStreamReader(fis);//字节流，充当转换器
        BufferedReader br =new BufferedReader(isr);//字符流
        String line;
        //public String readLine()返回字符串，当文件读完后继续调用则返回null
        //第一次调用readLine()会尽量填满BufferedReader的缓冲区，但是只返回第一行，继续调用则继续返回。
        while ((line = br.readLine()) != null){
            System.out.println(line);
        }
        br.close();
    }
}
